palette: return the BablModel created
authorØyvind Kolås <pippin@gimp.org>
Mon, 19 Mar 2012 15:24:36 +0000 (15:24 +0000)
committerØyvind Kolås <pippin@gimp.org>
Mon, 19 Mar 2012 15:24:36 +0000 (15:24 +0000)
babl/babl-palette.c
babl/babl.h

index 961e52a7b5907b803757c7da69f7edb592da12ac..4655211d3384d27e1d4be74560bf623316233bb6 100644 (file)
@@ -1,5 +1,5 @@
 /* babl - dynamically extendable universal pixel conversion library.
- * Copyright (C) 2005, Øyvind Kolås.
+ * Copyright (C) 2012, Øyvind Kolås.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -449,8 +449,9 @@ conv_pala8_pal8 (unsigned char *src, unsigned char *dst, long samples)
 /* should return the BablModel, permitting to fetch
  * other formats out of it?
  */
-void babl_new_palette (const char *name, const Babl **format_u8,
-                                         const Babl **format_u8_with_alpha)
+const Babl *babl_new_palette (const char  *name,
+                              const Babl **format_u8,
+                              const Babl **format_u8_with_alpha)
 {
   const Babl *model;
   const Babl *model_no_alpha;
@@ -579,6 +580,7 @@ void babl_new_palette (const char *name, const Babl **format_u8,
   if (format_u8_with_alpha)
     *format_u8_with_alpha = f_pal_a_u8;
   babl_sanity ();
+  return model;
 }
 
 void
index be629a25ed7efd1ca2b1a197bb9321755f9a112f..019b7b9a38700b9c03ca43589843572bb99c5e42 100644 (file)
@@ -200,13 +200,15 @@ int babl_format_is_format_n (const Babl *format);
 const Babl * babl_conversion_new (const void *first_arg,
                                   ...) BABL_ARG_NULL_TERMINATED;
 
+
 /**
  * create a new palette based format, name is optional pass in NULL to get
  * an anonymous format. If you pass in with_alpha the format also gets
- * an 8bit alpha channel.
+ * an 8bit alpha channel. Returns the BablModel of the color model.
  */
-void babl_new_palette (const char *name, const Babl **format_u8,
-                                         const Babl **format_u8_with_alpha);
+const Babl *babl_new_palette (const char  *name,
+                              const Babl **format_u8,
+                              const Babl **format_u8_with_alpha);
 
 /**
  * Assign a palette to a palette format, the data is a single span of pixels